package org.tiger.netty.server.first;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * @author lwl
 * @date 2020/9/17 10:31 下午
 */
public class TestServerInitializer extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ChannelPipeline channelPipeline = ch.pipeline();
		channelPipeline.addLast("httpServerCodec", new HttpServerCodec());
		channelPipeline.addLast("testServerHandler", new TestServerHandler());
	}
}
